% This is a sample LaTeX document.   If you run pdflatex on this file,
% it will produce a nicely formatted PDF document.  It is just like
% compiling a program.

% Anything after a % until end-of-line is a comment.

% First declare what kind of document you want.  That is the "documentclass".
% This is an article.  Other choices are book, letter, report, ....
% Options go in [...].   I want to use 11pt type.  (Default is 10pt.):

\documentclass[11pt]{article}

% Now import some packages: there are thousands of them.  There are many
% standard packages that come with any standard latex distribution. 
% graphicx is one that allows you to easily place images in your latex
% document, and gives you commands to manipulate them:

\usepackage{graphicx}

% The geometry packages lets you take control of margins and the page
% dimensions...

\usepackage[letterpaper,textheight=8in,left=1.25in,%
  textwidth=6.0in,bottom=1.5in]{geometry}

% This command was defined in the graphicsx package.   It takes a list
% of paths to directories in which graphicx will look for your images.
% By default, it will only look in the current directory (.).  If you
% want to compile this document you should change the path here to
% some place where you have some images...

\graphicspath{{../../../images/}}

% Declare who the author is, and while were at it, add a little
% "thank you" footnote--this is usually where you thank your funding
% agency....

\author{Stephen F.\ Siegel\thanks{Grand Poo-Bah, Software Engineers,
    Inc.}}

% Here's the title of the document:

\title{Software Engineering for Idiots}

% Here's the date.  If you don't do this, latex will fill it in for you
% with today's date (depending on document class):

\date{Feb 18, 2008}

%  Everything up to this point is known as the "Preamble".  It is not
% part of the document but just declarations.  The document proper
% starts with this command.   This is a special case of beginning
% an environment.  Whatever environment you begin, you must eventually
% end later on...

\begin{document}

% Make the title now.  This uses the information you declared in preamble:

\maketitle

% If you want a table of contents, here's how you get it...

\tableofcontents

% Finally, some actual document text.  Notice that white space
% doesn't matter: any number of spaces, tabs, newlines, etc., is
% equivalent to one space.  One exception: a blank line means
% "new paragraph".  Notice how you signify open and close double
% quotes: ``...''.   

Many     people ask, ``Why another stupid book on Software Engineering?''
I say ``phooey!'' There are actually three reasons I wrote it.  I will
describe each in turn.

% This starts a new section:

\section{The First Reason I Did It}

% You want boldface: use the \textbf command.   Emphasized text?  \emph.
% That usually translates to italics:

The \textbf{first} reason is: I got to use \LaTeX!  What could be more
\emph{fun}?

\section{The Second Reason I Did It}

The \textbf{second} reason is: I didn't have anything better to do!  I
mean, what else could I be doing?  Let us explore the possibilities.

% Within this section, let's declare a subsection.  Don't worry about
% keeping track of the numbers: latex will take care of it for you:

\subsection{Could I be listening to Beethoven symphonies?}

No!  Who has time to listen to Beethoven symphonies when there is
software engineering book-writing to be done?!

\subsection{Could I be watching TV?}

Heck, I can watch TV and write software engineering books at the same
time!



\section{The Third Reason I Did it}

The third reason is: everyone deserves to know about software
engineering, even you!

Here I will make a chart summarizing my three reasons:

% Here's a table.   You use a tabular environment: hence the \begin
% and \end commands surrounding the table.  {c|l} the column
% declaration: it says the first column will be centered (c), the second
% column will be left-justified (l), and there will be a vertical line
% between them (|).  & separates items in a row; \\ separates rows.

\begin{tabular}{c|l}
  Number & Reason\\ \hline
  1 & got to use \LaTeX\\
  2 & nothing else to do\\
  3 & unbounded generosity
\end{tabular}


% Options argument to \section: a "short version" of the name of
% the section.  It can be used in certain situations...

\section[Specification]{What Every Idiot Needs to Know About
  Specification}

I really want to see a waterfall at this point:

% let's use a centering environment and include a picture.  latex will
% look through my image directories declared in preamble for the png
% file.  The option scale naturally scales the image by the given
% factor.  There are MANY more such options; see graphicx
% documentation.

\begin{center}
  \includegraphics[scale=.5]{Waterfall_model.png}
\end{center}

\section{What Every Idiot Needs to Know About Design}

% Lists and such: this is like <ul> in HTML.   It's called an itemized
% list.

This will require making an unnumbered list:
\begin{itemize}
\item design is good
\item design is important
\item design will save you time
\item design will save you money
\item design will bring you happiness
\end{itemize}

% Citations:  of course I have references, and I want to cite them.
% At the end of this document, I define "keys" for each book, article,
% etc. that I'm going to cite.   When I want to refer to one of those
% things, I use the key.  Here I use the keys vadoo and poohbah.  Latex
% will take care of the details of numbering them...

Where did I get these ideas.  From the preeminent text \cite{vadoo}.
Sometimes \cite{poohbah} has something to say about them too.

\section{What Every Idiot Needs to Know about Verification}

% Here's a numbered list, like <ol> in HTML:

Sometimes a numbered list is called for:
\begin{enumerate}
\item verification is good
\item verification is important
\item verification will save you time
\item verification will save you money
\item verification will bring you happiness
\end{enumerate}

Quite often we need to see some figures.   These must ``float''.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.

% Here we have a floating figure.  Latex will find the best place
% on the page to put it.  I give it a caption, and a label:

\begin{figure}
  \begin{center}
    \begin{tabular}{l|l}
      \includegraphics[scale=.25]{Waterfall_model.png} &
      $t_w=t_r+t_d+t_i+t_v+      t_m$
    \end{tabular}
  \end{center}
  \caption{The waterfall model and associated time wastage equation}
  \label{fig:water}
\end{figure}

Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.

Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.
Blah blah blah blah blah.   Blah blah blah blah blah.

% This figure uses a verbatim environment.   Like <code> in HTML.

\begin{figure}
\begin{verbatim}
int main(int argv, char* argc[]) {
  foo();
  bar(&argv, ***x);
  return 1;
}
\end{verbatim}
  \caption{The verbatim environment is a good way to write up code.}
\end{figure}

\begin{thebibliography}{9}

\bibitem{vadoo} Spunky VaDoo, \emph{Design Will Save You Time}, Okie Fenoke
  Press, Tallahassee, Florida, 1932.

\bibitem{poohbah} Greatlink van PooBah, Specifying specifications:
  vernacular mutterings in the postmodern age, \emph{Jounral of
    Selective Thought}, vol.\ 7(2), May, 1988, 289--345.

\end{thebibliography}


\end{document}
